/*
 */

package com.railway.system.dao.impl;
import org.springframework.stereotype.Repository;

import java.util.*;
import org.apache.commons.lang.StringUtils;

import com.railway.common.base.*;
import com.railway.common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.railway.system.dao.*;
import com.railway.system.model.*;
import com.railway.system.service.*;
import com.railway.system.vo.query.*;

/**
 * @author  jiangcheng
 * @version 1.0
 * @since 1.0
 */




@Repository("sysRoleDao")
public class SysRoleDaoImpl extends BaseIbatisDao<SysRole,java.lang.String> implements ISysRoleDao{
	
	@Override
	public String getIbatisSqlMapNamespace() {
		return "SysRole";
	}
	
	public SysRole getById(java.lang.String id){
		return super.getById( id);
	}
	
	public void deleteById(java.lang.String id){
		super.deleteById(id);
	}
	
	/** 插入数据 */
	public void save(SysRole entity){
		if(StringUtils.isEmpty(entity.getId())) {
			entity.setId(IdGenerator.genUUIDStr());
		}
		super.save(entity);
	}
	
	/** 更新数据 */
	public void update(SysRole entity){
		super.update(entity);
	}

	public boolean isUnique(SysRole entity, String uniquePropertyNames){
		return super.isUnique( entity, uniquePropertyNames);
	}
	
	public List<SysRole> findAll(){
		return super.findAll();
	}
	
	public void saveOrUpdate(SysRole entity) {
		if(StringUtils.isEmpty(entity.getId())) {
			entity.setId(IdGenerator.genUUIDStr());
			super.save(entity);
		}
		else 
			super.update(entity);
	}
	
	public Page findPage(SysRoleQuery query) {
		return pageQuery("SysRole.findPage",query);
	}
	
}
